﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data.SqlClient;
using System.Web.Configuration;
using System.Data;
namespace NCKH
{
    public partial class noidungtintuc : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)

                if (Request.QueryString["id"] != null)
                {
                    int NewID = Convert.ToInt32(Request.QueryString["id"]);
                    hiennoidungtin(NewID);
                }

        }
        protected void hiennoidungtin(int NewID)
        {
            string connection = ConfigurationManager.ConnectionStrings["NCKH"].ConnectionString;
            string select_tintuc = "SELECT Manoidungtin, Tieude, Ngaytao, Tomtat, Noidung FROM NOIDUNGTIN WHERE Manoidungtin='" + NewID + "'";
            using (SqlConnection cnn = new SqlConnection(connection))
            {
                using (SqlCommand cmd = new SqlCommand(select_tintuc, cnn))
                {
                    cmd.CommandType = CommandType.Text;
                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        DataTable tb = new DataTable();
                        da.Fill(tb);
                        chitiettin.DataSource = tb;
                        chitiettin.DataBind();
                    }
                }
            }
        }

        protected void chitiettin_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

    }
}